// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.modules.common.controller;

import com.liuxinlong.modules.common.controller.request.BaseDeleteReq;
import com.liuxinlong.modules.common.controller.request.QueryBaseReq;
import com.liuxinlong.modules.common.controller.request.QueryLuckReq;
import com.liuxinlong.modules.common.controller.response.CommonSelectResp;
import com.liuxinlong.modules.common.entity.CommonSelectDto;
import com.liuxinlong.modules.common.service.CommonSelectService;
import com.liuxinlong.modules.material.controller.request.QueryMaterialReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 通用下拉选项控制层
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2021-12-31
 */
@RestController
@RequestMapping("/common-select")
public class CommonSelectController {
    @Autowired
    private CommonSelectService commonSelectService;

    /**
     * 查询用户部门
     *
     * @return 用户部门信息
     */
    @GetMapping("department")
    public CommonSelectResp queryDepartmentSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryDepartmentSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取用户部门列表成功");
        return resp;
    }

    /**
     * 查询用户
     *
     * @return 用户信息
     */
    @GetMapping("user")
    public CommonSelectResp queryUserSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryUserSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取用户列表成功");
        return resp;
    }

    /**
     * 查询角色
     *
     * @return 角色信息
     */
    @GetMapping("role")
    public CommonSelectResp queryRoleSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryRoleSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取角色列表成功");
        return resp;
    }

    /**
     * 查询岗位
     *
     * @return 岗位信息
     */
    @GetMapping("post")
    public CommonSelectResp queryPostSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryPostSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取岗位列表成功");
        return resp;
    }

    /**
     * 查询用户等级
     *
     * @return 用户等级信息
     */
    @GetMapping("user-level")
    public CommonSelectResp queryUserLevelSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryUserLevelSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取用户等级列表成功");
        return resp;
    }

    /**
     * 查询小队
     *
     * @return 小队信息
     */
    @GetMapping("team")
    public CommonSelectResp queryTeamSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryTeamSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取小队列表成功");
        return resp;
    }

    /**
     * 查询菜单
     *
     * @return 菜单信息
     */
    @GetMapping("menu")
    public CommonSelectResp queryMenuSelect() {
        CommonSelectResp resp = new CommonSelectResp();
        resp.setRetMessage("获取菜单列表成功");
        return resp;
    }

    /**
     * 查询设计标准
     *
     * @return 设计标准信息
     */
    @GetMapping("standard")
    public CommonSelectResp queryDesignStandardSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryDesignStandardSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取设计标准列表成功");
        return resp;
    }

    /**
     * 查询标准分类
     *
     * @return 标准分类信息
     */
    @GetMapping("classification")
    public CommonSelectResp getParentClassificationList() {
        List<CommonSelectDto> resultList = commonSelectService.queryParentClassificationSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取标准分类列表成功");
        return resp;
    }

    /**
     * 查询问题处理类型
     *
     * @return 问题处理类型信息
     */
    @GetMapping("question-deal")
    public CommonSelectResp queryDealTypeSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryDealTypeSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取问题处理类型列表成功");
        return resp;
    }

    /**
     * 查询问题状态
     *
     * @return 问题状态信息
     */
    @GetMapping("question-status")
    public CommonSelectResp queryQuestionStatusSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryQuestionStatusSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取问题状态列表成功");
        return resp;
    }

    /**
     * 查询论坛板块
     *
     * @return 设计标准信息
     */
    @GetMapping("plate")
    public CommonSelectResp queryBarPlateSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryBarPlateSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取论坛板块列表成功");
        return resp;
    }

    /**
     * 查询用户组
     *
     * @return 用户组信息
     */
    @GetMapping("user-group")
    public CommonSelectResp queryUserGroupSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryUserGroupSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取用户组列表成功");
        return resp;
    }

    /**
     * 查询文件业务类型
     *
     * @return 文件业务类型信息
     */
    @GetMapping("file-business")
    public CommonSelectResp queryFileBusinessSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryFileBusinessSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取文件业务类型信息列表成功");
        return resp;
    }

    /**
     * 查询物料信息
     *
     * @return 物料信息
     */
    @PostMapping("material")
    public CommonSelectResp queryMaterialSelect(@RequestBody QueryMaterialReq req) {
        List<CommonSelectDto> resultList = commonSelectService.queryMaterialSelect(req.getName(), req.getRegion());
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询物料信息列表成功");
        return resp;
    }

    /**
     * 查询标准分类
     *
     * @return 标准分类信息
     */
    @PostMapping("classification-sub")
    public CommonSelectResp getSubClassificationList(@RequestBody BaseDeleteReq req) {
        List<CommonSelectDto> resultList = commonSelectService.querySubClassificationList(req.getId());
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取标准分类列表成功");
        return resp;
    }

    /**
     * 查询培训文档标题
     *
     * @return 培训文档标题信息
     */
    @GetMapping("train")
    public CommonSelectResp queryTrainSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryTrainSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取培训文档标题信息列表成功");
        return resp;
    }

    /**
     * 查询培训文档业务类型
     *
     * @return 培训文档业务类型
     */
    @GetMapping("train-business")
    public CommonSelectResp queryTrainBusinessSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryTrainBusinessSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("获取培训文档业务类型列表成功");
        return resp;
    }

    /**
     * 查询培训文档专家子标题
     *
     * @return 培训文档专家子标题信息
     */
    @GetMapping("expert-sub")
    public CommonSelectResp queryExpertSubSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryExpertSubSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("培训文档专家子标题信息列表成功");
        return resp;
    }

    /**
     * 查询消息推送来源
     *
     * @return 消息推送来源信息
     */
    @GetMapping("message-source")
    public CommonSelectResp queryMessageSourceSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryMessageSourceSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("消息推送来源信息列表成功");
        return resp;
    }

    /**
     * 查询培训文档专利子标题
     *
     * @return 培训文档专利子标题信息
     */
    @GetMapping("patent-sub")
    public CommonSelectResp queryPatentSubSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryPatentSubSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("培训文档专利子标题信息列表成功");
        return resp;
    }

    /**
     * 查询论坛积分关联业务
     *
     * @return 论坛积分关联业务信息
     */
    @GetMapping("points-business")
    public CommonSelectResp queryPointsBusinessSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryPointsBusinessSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询论坛积分关联业务信息成功");
        return resp;
    }

    /**
     * 查询论坛积分明细来源
     *
     * @return 论坛积分明细来源信息
     */
    @GetMapping("points-source")
    public CommonSelectResp queryPointsSourceSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryPointsSourceSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询论坛积分明细来源信息成功");
        return resp;
    }

    /**
     * 查询培训文档子分类
     *
     * @param req 请求信息
     * @return 培训文档子分类列表
     */
    @PostMapping("train-sub")
    public CommonSelectResp queryTrainSubSelect(@RequestBody QueryBaseReq req) {
        List<CommonSelectDto> resultList = commonSelectService.queryTrainSubSelect(req.getId());
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询培训文档子分类成功");
        return resp;
    }

    /**
     * 查询消息推送内容分类
     *
     * @return 消息推送内容分类列表
     */
    @GetMapping("message-content")
    public CommonSelectResp queryMessageContentSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryMessageContentSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询消息推送内容分类成功");
        return resp;
    }

    /**
     * 查询专家组分类
     *
     * @return 专家组分类列表
     */
    @GetMapping("expert-group")
    public CommonSelectResp queryExpertGroupSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryExpertGroupSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询专家组分类成功");
        return resp;
    }

    /**
     * 查询专家列表
     *
     * @return 专家列表
     */
    @PostMapping("expert")
    public CommonSelectResp queryExpertSelect(@RequestBody QueryBaseReq req) {
        List<CommonSelectDto> resultList = commonSelectService.queryExpertSelect(req.getId());
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询专家列表成功");
        return resp;
    }

    /**
     * 查询缓存key列表
     *
     * @return 缓存key列表
     */
    @GetMapping("redis")
    public CommonSelectResp queryRedisSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryRedisSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询缓存key列表成功");
        return resp;
    }

    /**
     * 查询物料成本卷积状态列表
     *
     * @return 物料成本卷积状态列表
     */
    @GetMapping("convolution-status")
        public CommonSelectResp queryConvolutionStatusSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryConvolutionStatusSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询物料成本卷积状态列表成功");
        return resp;
    }

    /**
     * 查询活动信息列表
     *
     * @return 活动信息列表
     */
    @PostMapping("luck")
    public CommonSelectResp queryBarLuckSelect(QueryLuckReq req) {
        List<CommonSelectDto> resultList = commonSelectService.queryBarLuckSelect(req.getStatus() - 1);
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询活动信息列表成功");
        return resp;
    }

    /**
     * 查询礼品信息列表
     *
     * @return 礼品信息列表
     */
    @PostMapping("present")
    public CommonSelectResp queryBarPresentSelect(QueryLuckReq req) {
        List<CommonSelectDto> resultList = commonSelectService.queryBarPresentSelect(req.getStatus() - 1);
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询礼品信息列表成功");
        return resp;
    }

    /**
     * 查询专利部门列表
     *
     * @return 专利部门列表
     */
    @GetMapping("patent-department")
    public CommonSelectResp queryPatentDepSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryPatentDepSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询专利部门列表成功");
        return resp;
    }

    /**
     * 查询专利产品品类列表
     *
     * @return 专利部门列表
     */
    @GetMapping("patent-product")
    public CommonSelectResp queryPatentProductSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryPatentProductSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询专利产品品类列表成功");
        return resp;
    }

    /**
     * 查询资产项目类型列表
     *
     * @return 资产项目类型列表
     */
    @GetMapping("assets-project-type")
    public CommonSelectResp queryAssetsProjectTypeSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryAssetsProjectTypeSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询资产项目类型列表成功");
        return resp;
    }

    /**
     * 查询资产类型列表
     *
     * @return 资产类型列表
     */
    @GetMapping("assets-type")
    public CommonSelectResp queryAssetsTypeSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryAssetsTypeSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询资产类型列表成功");
        return resp;
    }

    /**
     * 查询固资预算列表
     *
     * @return 固资预算列表
     */
    @GetMapping("assets-budget")
    public CommonSelectResp queryAssetsBudgetSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryAssetsBudgetSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询固资预算列表成功");
        return resp;
    }

    /**
     * 查询固资部门列表
     *
     * @return 固资部门列表
     */
    @GetMapping("assets-department")
    public CommonSelectResp queryAssetsDepartmentSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryAssetsDepartmentSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询固资部门列表成功");
        return resp;
    }

    /**
     * 查询ecn变更类型列表
     *
     * @return ecn变更类型列表
     */
    @GetMapping("ecn-change-type")
    public CommonSelectResp queryEcnChangeTypeSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryEcnChangeTypeSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询ecn变更类型列表成功");
        return resp;
    }

    /**
     * 查询有效项目列表
     *
     * @return 有效项目列表
     */
    @GetMapping("project")
    public CommonSelectResp queryProjectSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryProjectSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询有效项目列表成功");
        return resp;
    }

    /**
     * 查询设计差异点列表
     *
     * @return 设计差异点列表
     */
    @PostMapping("patent-risk")
    public CommonSelectResp queryPatentRiskSelect(@RequestBody BaseDeleteReq req) {
        List<CommonSelectDto> resultList = commonSelectService.queryPatentRiskSelect(req.getId());
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询设计差异点列表成功");
        return resp;
    }

    /**
     * 查询流程业务类型列表
     *
     * @return 流程业务类型列表
     */
    @GetMapping("workflow-type")
    public CommonSelectResp queryWorkflowTypeSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryWorkflowTypeSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询流程业务类型列表成功");
        return resp;
    }

    /**
     * 查询流程用户组列表
     *
     * @return 流程用户组列表
     */
    @GetMapping("workflow-group")
    public CommonSelectResp queryWorkflowGroupSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryWorkflowGroupSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询流程用户组列表成功");
        return resp;
    }

    /**
     * 查询项目阶段列表
     *
     * @return 项目阶段列表
     */
    @GetMapping("project-stage")
    public CommonSelectResp queryProjectStageSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryProjectStageSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询项目阶段列表成功");
        return resp;
    }

    /**
     * 查询流程配置列表
     *
     * @return 流程配置列表
     */
    @GetMapping("workflow-config")
    public CommonSelectResp queryWorkflowConfigSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryWorkflowConfigSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询流程配置列表成功");
        return resp;
    }

    /**
     * 查询测算配置类型列表
     *
     * @return 测算配置类型列表
     */
    @GetMapping("investment-config-type")
    public CommonSelectResp queryInvestmentConfigTypeSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryWorkflowConfigSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询测算配置类型列表成功");
        return resp;
    }

    /**
     * 查询测算其他一次性支出配置类型列表
     *
     * @return 测算配置类型列表
     */
    @GetMapping("investment-expenses-type")
    public CommonSelectResp queryInvestmentExpensesTypeSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryInvestmentExpensesTypeSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询测算其他一次性支出配置类型列表成功");
        return resp;
    }

    /**
     * 查询测算损益费率配置类型列表
     *
     * @return 测算配置类型列表
     */
    @GetMapping("investment-loss-rate-type")
    public CommonSelectResp queryInvestmentLossRateTypeSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryInvestmentLossRateTypeSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询测算损益费率配置类型列表成功");
        return resp;
    }

    /**
     * 查询测算损益费率配置类型列表
     *
     * @return 测算配置类型列表
     */
    @GetMapping("investment-turnover-type")
    public CommonSelectResp queryInvestmentTurnoverTypeSelect() {
        List<CommonSelectDto> resultList = commonSelectService.queryInvestmentTurnoverTypeSelect();
        CommonSelectResp resp = new CommonSelectResp();
        resp.setResultList(resultList);
        resp.setRetMessage("查询测算损益费率配置类型列表成功");
        return resp;
    }
}